﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Logic;
using Logic.ClarizenObjects;
using Logic.ClarizenSvc;

namespace ClarizenGadget.Controllers
{
    public class UsersController : Controller
    {
        [HttpPost]
        public ActionResult Index(String q)
        {
            var res = new QueryComponent().GetListByTypeName("User", q, 20);
            return Json(res.Select<GenericEntity,Object>(r => new {id=r.Id.Value, name=r.Values[0].Value }));
        }

    }
}
